-
-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the CameraShutter-related logic on UX5406 #3359
Conversation
@yinyue200 262144 and 262145 is same 0 and 1, just with (one more) status bit on 19th place So to actually "read" shutter status you can just do I didn't completely get your explanation tho. Does it mean that there is no need to set any value to 0x00060078 at all ? How does it toggle it then? |
Yes, a DSTS message must be sent to read the status in order to toggle the Camera key; no additional DEVS messages are required. A standalone DSTS message will not work; the user must have recently pressed the corresponding physical key. |
@yinyue200 yes, DSTS only reads status. But how to toggle camera shutter ON and OFF then ? If application is not send any command for what, who does? |
My understanding is that, on my device, the logic for the camera shutter is implemented by the firmware. No software can send a message to toggle its status. However, when the corresponding camera shutter button is pressed, the software must initiate a DSTS message within a certain time to enable the logic in the firmware. ASUS designed it this way so that software cannot toggle the camera shutter status, thereby avoiding some security risks. I’m not sure if earlier machines have similar logic, but that’s how it works on my machine. |
@yinyue200 ah, ok, interesting and makes sense. Are you sure that it's not just working by itself on hardware level (i.e. w/o calling DSTS) ? Then I also wonder if this part is even needed
As I'm not sure if other devices behave differently then. |
Yes, but it seems that in asus_shutter.c, it simply uses 1 and 0 rather than shifting 1 and 0 by specific bit positions. Therefore, I suspect that slightly earlier machines (or firmware?) required a DEVS message to toggle the CameraShutter status. |
@yinyue200 ok, then lets keep both response variants, and keep them separate. Thanks, and merged. |
To add a bit more information, I've tested many times on my machine, and if there is no DSTS message, the key still retains its primary function (prevent the camera on) . However, the CameraShutter LED indicator on the keyboard will remain off (if there are DSTS messages it works fine). When the camera is in use, though, its status can be indirectly observed through the camera indicator light. It’s also possible that this is just a bug in the current firmware. But we don't have the documentation. |
I apologize that my initial PR (#3358 ) did not correctly implement this feature. Initially, although I disabled Secure Boot and used tools like IRPMon to monitor ACPI messages sent by MyASUS, I found that the same DSTS message was sent regardless of whether the Camera was turned on or off. I assumed there was an issue with my monitoring setup, so I looked up asus-shutter-linux on GitHub and referenced that project to implement the relevant logic.
In my environment, OSD is disabled, and I did not run Visual Studio with administrator privileges. Under these conditions, the related keys functioned as expected following the logic from asus-shutter-linux. However, after running the 'scan' function, I noticed that on my machine (which differs from the model indicated in asus-shutter-linux), the return values were '262144' or '262145' rather than '0' or '1'.
After some testing, I found that for the CameraToggle to work correctly, a corresponding DSTS message must be sent after pressing it. On my machine, the DEVS message is unnecessary, as sending it alone does not change the CameraShutter state (which makes sense, as it should not allow unauthorized activation of the camera). This version should now correctly implement the feature and is ready for merging.